import 'package:get/get.dart';
import 'package:share_fit/app/controllers/base/base_controller.dart';
import 'package:share_fit/app/helper/ext/tr_ext.dart';
import 'package:share_fit/generated/locales.g.dart';

import 'state.dart';

class AwakeLogic extends BaseController {
  final AwakeState state = AwakeState();

  goBackSleepPage() {
    Get.back();
  }

  @override
  String getRemotePath() {
    throw '';
  }

  @override
  void initState() {
    state.awakeTimes = Get.arguments['value'] ?? 0;
    state.level = Get.arguments['level'] ?? '';
    state.color = Get.arguments['color'] ?? 0x00000000;
  }

  @override
  void onRemoteEvent(event, method) {
    // TODO: implement onRemoteEvent
  }

  String getPercentValueText() {
    return '${state.awakeTimes} ${LocaleKeys.sleep_awake_times_unit_text.ts}';
  }
}
